//
// Created by Tony on 2024/7/2.
//

#include "FieldDefine.h"
#include "../../../../compiler/Visitor.h"
#include <memory>

namespace Parser {

int32_t FieldDefine::accept(Compiler::Visitor* visitor) { return visitor->visit(this); }

std::shared_ptr<AccessFlags> FieldDefine::getAccessFlags() {
    return static_pointer_cast<AccessFlags>(children[0]);
}

string FieldDefine::getName() { return static_pointer_cast<Name>(children[1])->name(); }

std::shared_ptr<TypeTag> FieldDefine::getTypeTag() {
    return static_pointer_cast<TypeTag>(children[2]);
}

std::shared_ptr<Ast> FieldDefine::getInitExpr() { return children[3]; }

} // namespace Parser